import { Table } from 'antd';
import {useEffect, useState} from "react";
import {getData} from "../../../../api";
import {columns} from './columns'
interface DataType {
    key: string;
    name: string;
    address: number;
    num:number;
}
const List = () => {
    const [userList, setUserList] = useState<DataType[]>([]);
    useEffect(()=>{
        getData().then((res:any)=>{
            console.log('res',res.data.data)
            setUserList(res.data.data.tableData)
        })
    },[])

     return (
     <Table 
        style={{marginTop:'20px',width:'350px'}}
        scroll={{y:440}}
        columns={columns}
        dataSource={userList} 
        pagination={false}
     />
     )
}
export default List;